$(function (){
    let app = new Vue({
        el: "#app",
        data: {
            sysTitle: "固定资源管理系统",
            id: "10011001101",
            name: "林耿奎",
            password: "123",
            userType: "1",
            Info: ["用户账号：","用户密码：","用户类型："],
            userName: "",
            userImageSrc: "images/common/headPhoto.png",
            backImageSrc: "../../images/common/back.jpg",
            aMessage: [{name: "忘记密码", href: "newPwd.html"},{name: "管理员注册", href: "newUser.html"}]
        },
        created(){

        },
        methods: {
            handleLogin(){
                if(this.id === "")
                {
                    alert("请输入账号!");
                    return;
                }else {
                    if(this.id.length !== 11)
                    {
                        alert("手机位数不等于11位,请检查!");
                        return;
                    }
                }
                if(this.password === "")
                {
                    alert("请输入密码!");
                    return;
                }
                if(this.userType === "-1")
                {
                    alert("请选择用户类型!");
                    return;
                }
                this.loginIn();
            },
            loginIn(){
                sessionStorage.setItem("userID", this.id);
                sessionStorage.setItem("userName", this.name);
                sessionStorage.setItem("userType", this.userType);
                sessionStorage.setItem("userImageSrc", this.userImageSrc);
                location.href = "../../index.html";
            }

        }
    });
});